<template>
  <div id="app">
    <router-view/>
<!--    <button @click="login">请求login</button>-->
<!--    <div class="message">{{login_result}}</div>-->
<!--    <br>-->
<!--    <button @click="user">请求getAllUser</button>-->
<!--    <div class="message">{{user_result}}</div><br>-->
<!--    <button @click="logout">请求logout</button>-->
<!--    <div class="message">{{logout_result}}</div>-->
  </div>
</template>

<script>
  // import axios from 'axios'

  export default {
    name: 'app',
    data(){
      return{
        login_result : "",
        user_result:"",
        logout_result:""
      }
    },
    methods:{
      login(){
        let params = new URLSearchParams();
        params.append('username',"admin");
        params.append('password',"123");
        this.$http({
          url:"/epidemic/admin/login",
          method:"post",
          header:{
            "content-type":"application/x-www-form-urlencoded"
          },
          data:params
        }).then(res => {
          console.log(res)
         this.login_result = res
        }).catch(err => {
          console.log(err)
        })
      },
      user(){
        this.$http({
          url : "/epidemic/admin/getAllUser",
          method : "post"
        }).then(res => {
          console.log(res)
          console.log(res)
          this.user_result = res
        }).catch(err => {
          console.log(err)
        })
      },
      logout(){
        this.$http({
          url:"/epidemic/admin/logout",
          method : "post"
        }).then(res => {
          console.log(res)
          this.logout_result = res
        }).catch(err => {
          console.log(err)
        })
      }
    }
  }
</script>
<style>
  @import "assets/css/base.css";
  @import "assets/fa/css/all.css";
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /*position: absolute;*/
  /*left: 50%;*/
  /*top: 50%;*/
  /*transform: translate(-50%,-40%);*/
}
  .message{
    width: 300px;
    height: 100px;
    border: 1px solid #333333;
  }
  button{
    background-color: #92dcdc;
    margin: 10px;
  }
  html,body,#app{
    height: 100%;
  }
  /*#app{*/
  /*  display: flex;*/
  /*}*/
</style>
